package com.kai.service.Impl;

import com.kai.dao.CommentMapper;
import com.kai.pojo.Comment;
import com.kai.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentServiceImpl implements CommentService {
    @Autowired
    private CommentMapper commentMapper;
    @Override
    public List<Comment> selectCommentByCourseId(String courseId) {
        return commentMapper.selectCommentByCourseId(courseId);
    }

    @Override
    public int selectCountComment() {
        return commentMapper.selectCountComment();
    }

    @Override
    public List<Comment> selectAllComment(int pageNum, int pageSize) {
        return commentMapper.selectAllComment(pageNum,pageSize);
    }

    @Override
    public int reply(Comment comment) {
        return commentMapper.reply(comment);
    }

    @Override
    public int insertComment(Comment comment, String courseId, String userId) {
        return commentMapper.insertComment(comment,courseId,userId);
    }

    @Override
    public int annuallyComment(String s) {
        return commentMapper.annuallyComment(s);
    }
}
